package com.cms.dao.mapper;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import com.cms.common.annotation.RecordLog;
import com.cms.exception.SystemDBException;
import com.cms.model.TrAdminUser;

/****
 * 
 * @author Administrator
 *
 */
@Component("userMapper")
public interface AdminUserMapper {

	 /***
	  * 
	  * @param user
	  * @return
	  */
	 public TrAdminUser login(@Param("user")TrAdminUser user);
	 
	 
	 /***
	  * 
	  * @param id
	  */
	 public void updateLoginDate(@Param("user")TrAdminUser user);
	 
	 /***
	  * 
	  * @param user
	  * @throws SystemDBException
	  */
	 @RecordLog(expression="添加管理员[${id}]${userName}",name="userName",catalog="managerInfo")
	 public void register(@Param("user")TrAdminUser user)throws SystemDBException;
	 
	 
	 /***
	  * 
	  * @param user
	  * @return
	  */
	 public TrAdminUser getUserInfo(@Param("user")TrAdminUser user);
	 
	 /***
	  * 
	  * @param user
	  * @return
	  */
	 @RecordLog(expression="修改管理员[${id}]${userName}信息",name="userName",catalog="managerInfo")
	 public void updateUserInfo(@Param("user")TrAdminUser user)throws SystemDBException;
	 
	 /***
	  * 
	  * @param user
	  * @return
	  */
	 @RecordLog(expression="删除管理员[${id}]",name="userName",catalog="managerInfo")
	 public void deleteUserInfo(@Param("user")TrAdminUser user)throws SystemDBException;
	 

	 /***
	  * 
	  * @param user
	  * @throws SystemDBException
	  */
	 @RecordLog(expression="修改管理员[${id}]${userName}状态",name="userName",catalog="managerInfo")
	 public void changeUserStatus(@Param("user")TrAdminUser user)throws SystemDBException;
	 
	 /***
	  * 
	  * 
	  * 
	  * @param user
	  * @throws SystemDBException
	  */
	 public void updateSelfUserInfo(@Param("user")TrAdminUser user) throws SystemDBException;
}
